<template>
    <div>
        <p>{{ message }}</p>
        <input v-model="message">
    </div>
</template>

<script>
    export default {
        name: "DemoWatch",
        data(){
            return{
                message: 'Hello Vue!',

            }
        },
        methods:{

        },
        watch:{
            message(newV, oldV) {
                // do something
                console.log(newV, oldV);
                alert('新值:'+newV+'老值:'+oldV)


                // this.$emit('backNewKey', newV)
            },
        }

    }
</script>

<style scoped>

</style>
